﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 挂载到卡片预制体上的组件
/// </summary>
public class CardUI : MonoBehaviour
{
    private CardBase cardAttr;
    private Text cardNameText;
    public void cardUIInit(CardBase cardbase)
    {
        cardAttr = cardbase;
    }

    public CardBase getCardAttr(){
        return cardAttr;
    }
    void Start()
    {
        cardNameText = gameObject.transform.GetComponentInChildren<Text>();
        cardNameText.text = cardAttr.name;
    }

    void Update()
    {

    }

    public CardBase GetCardAttr(){
        return cardAttr;
    }

    public void OnPlayerClick()
    {
        GameObject.Find("cardShowManger").GetComponent<ShowCardInfoMan>().setShowCard(this);    
    }

}
